using System;

namespace AGame.TabOrm.TabOrmAttributeExpand
{
    public enum AbyssConfigPath
    {
        Editor,
        Logic,
        Ui,
    }
    
    public class AbyssEditorTable : Table
    {
        public AbyssEditorTable(AbyssConfigPath path, string tableName) : base(MakePath(path, tableName))
        {
            if (path == AbyssConfigPath.Editor)
            {
                ConfigPath = false;
            }
        }

        private static string MakePath(AbyssConfigPath path, string tableName)
        {
            switch (path)
            {
                case AbyssConfigPath.Editor:
                    return $"/Scripts/XSJGame/Editor/EditorConfig/{tableName}.tab";
                case AbyssConfigPath.Logic:
                    return $"Config/TxtTable/Logic/{tableName}.tab";
                case AbyssConfigPath.Ui:
                    return $"Config/TxtTable/UI/{tableName}.tab";
                default:
                    throw new ArgumentOutOfRangeException(nameof(path), path, null);
            }
        }
    }
}